package com.koala.learn.threadlearn.charter8;

import lombok.SneakyThrows;

import java.util.concurrent.CountDownLatch;

/**
 * @Description TODO
 * CountDownLatch
 * @Date 2022/3/2 8:41
 * @Created by koala
 */

public class Start {

    static CountDownLatch c = new CountDownLatch(3);

    @SneakyThrows
    public static void main(String[] args) {
        new Thread(() -> {
            System.out.println(1);
            c.countDown();
            System.out.println(2);
//            c.countDown();
        }).start();
        c.await();
        System.out.println(3);
    }
}
